%%%% Solution Algorithm for the Representative-Agent Equivalent for the Aiyagari (1994,QJE)                  
function F=steady_counterfactual(y,alpha,beta,delta,gamma,varphi,zbar,hbar)
% Assignment of Endogenous Variables as:
% y(1) Capital (k)
% y(2) Forgone Lump-Sum Consumption

k=y(1);
closs=y(2);
h=hbar;
l=zbar*h; %effective labor (l)

F(1)=1-beta*(1+(alpha*(l/k)^(1-alpha)-delta));                                                                                        % Consumption-Investment Optimality Condition (i.e. Euler Equation)
F(2)=(k^alpha)*(l^(1-alpha))-((h^(1/varphi))/((1-alpha)*h^(-alpha)*(k^alpha)*zbar^(1-alpha)))^(-1/gamma)-delta*k-closs;                     % Aggregate Budget Constraint


